#ifndef CGROUPITEM_H
#define CGROUPITEM_H

#include "CPropertyEditorItem.h"
#include "CPropertyItem.h"
#include <set>

//-------------------------------------

struct LessPropItem : public std::binary_function< CPropertyItem *, CPropertyItem *, bool >
{
    bool operator()( const CPropertyItem * arg1, const CPropertyItem * arg2 ) const
    {
        return arg1->GetKey() < arg2->GetKey();
    }
};

//-------------------------------------

class CGroupItem : public CPropertyEditorItem
{

    CPropertyEditor * owner;
    QString name;
    std::set< CPropertyItem*, LessPropItem > items;
    friend class CPropertyItem;
public:
    CGroupItem( CPropertyEditor * _owner, const QString & _name );
    void Map( std::vector<CPropertyEditorItem*> & v );
    virtual CPropertyEditor * Editor() { return owner; }
    void AddItem( CPropertyItem * item );
    void DeleteItem( const QString & key );
    const QString & GetName() const { return name; }
    CPropertyItem * GetItem( const QString & key );
};

#endif // CGROUPITEM_H
